#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
int main(void)
{
	long d = 0;
	scanf("%ld", &d);
	for (double i = 0; i <= d; i++){
		long b;
		b = pow(3.0, i);
		printf("pow(3,%d) = %ld\n", i, b);
	}
	return 0;
}